SHELL=/bin/bash
MACA_PATH?=/opt/maca
IDIR?=-I$(MACA_PATH)/include
LDIR?=-L$(MACA_PATH)/lib
TARGET_FPROP?=conv_fprop
MXCC?=$(MACA_PATH)/mxgpu_llvm/bin/mxcc
MXCCFLAGS?=-x maca

all: $(TARGET_FPROP)

$(TARGET_FPROP):
	$(MXCC) $(MXCCFLAGS) --maca-path=$(MACA_PATH) conv_fprop_example.cpp example_utils.cpp \
	   $(IDIR)  $(LDIR) -lmcdnn -o $(TARGET_FPROP)

run: $(TARGET_FPROP)
	source env_setup.sh && $(shell find ./ -name $(TARGET_FPROP))

clean:
	rm -f $(TARGET_FPROP)